<?php
 
include 'conn.inc.php';
$mysqli=new Mysqli(HOST,USER,PWD,DBNAME);
if($mysqli->connect_errno){
   die('数据库链接出错'.$mysqli->connect_error);
}

//var_dump($mysqli);


// class Mysqli
// {
// 	public $db_host;//数据库主机
// 	public $db_user;//数据库用户名
// 	public $db_pwd;//数据库用户名密码
// 	public $db_name;//数据库名
// 	public $conn;//数据库连接标识;
// 	public $result;//执行query命令的结果资源标识
// 	public $sql;//sql执行语句
// 	public $row;//返回的条目数
// 	public $db_charset; //数据库编码，GBK,UTF8,gb2312
// 	public $connect_errno;
// 	public $connect_error;

// 	/*构造函数*/
// 	public function __construct($db_host, $db_user, $db_pwd, $db_name, $db_charset)
// 	{
// 		$this->db_host = $db_host;
// 		$this->db_user = $db_user;
// 		$this->db_pwd = $db_pwd;
// 		$this->db_name = $db_name;
		
// 		$this->db_charset = $db_charset;
// 		$this->connect();
// 	}

// 	/*数据库连接*/
// 	public function connect()
// 	{
// 		$this->conn = mysqli_connect($this->db_host, $this->db_user, $this->db_pwd, $this->db_name);
	
// 	if (mysqli_errno($this->conn)) {
// 		mysqli_error($this->conn);
// 		exit;
// 	}
// 	mysqli_set_charset($this->conn, $this->db_charset);

// 	return $this->conn;
// 	}
   
// }



